<template>
    <div class="classlist">
        <van-nav-bar fixed title="分类" left-arrow @click-left="back()" />
        <page class="classlist" >
            <item :list="state.classlist"></item>

        </page>
    </div>
</template>
  
<script setup lang="ts">
import { onMounted, ref, reactive } from "vue";
import { useRouterAction } from "@/utils/router";
import { activity } from "@/serve/_";
const { back, push } = useRouterAction()
import { IndexType } from "@/types/res/home";


const { route } = useRouterAction()

//定义变量
const state: {
    value: string,//搜索框的关键字
    classlist: [] | IndexType,//接口请求到的字段
} = reactive({
    value: '',
    classlist: []
})


onMounted(async () => {
    getactivity()
    console.log(route().query.id)
})
let getactivity = async () => {
    state.classlist = await activity({
        id: String(route().query.id)
    });
    console.log('请求到的接口数据', state.classlist);

}

</script>
  
<style scoped lang="less">
@import "@page/me.less";
</style>
  